<template>
  <yt-page title="添加检查情况" :leftData="leftData">
    <yt-cell label="隐患位置">
      <div slot="default" class="flex">
        <yt-input v-model="item.place"></yt-input>
        <i class="iconfont icon-voice"></i>
      </div>
    </yt-cell>
    <yt-cell label="隐患类别">
      <yt-cell-select></yt-cell-select>
    </yt-cell>
    <yt-textarea v-model="textareaValue">
      <div slot="default" class="flex">
        <span>隐患描述</span>
        <i class="iconfont icon-voice"></i>
      </div>
    </yt-textarea>
    <yt-file :uploadFile="uploadFile" v-model="fileList"></yt-file>
    <yt-btn class="m-t">录入检查情况</yt-btn>
  </yt-page>
</template>

<script>
export default {
  data() {
    return {
      leftData: [
        {
          font: 'iconfont icon-left',
          click: () => {
            this.$router.$back()
          }
        }
      ],
      item: {},
      textareaValue: 'xxx',
      fileList: [],
      uploadFile: file =>
        commonApi
          .uploadFile(file)
          .then(({ _name, _url }) => ({ name: _name, url: _url }))
    }
  },
  activated() {}
}
</script>

<style lang="stylus" scoped>
.flex
  width 100%
  display flex
  align-items center
  justify-content space-between

  .yt-input input
    text-align right

.iconfont
  font-size 25px
  color #46baff

>>>.yt-file
  background-color #fff
</style>
